import java.io.IOException;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.Scanner;

public class ClientSend implements Runnable{
    private Socket socket;
    private ObjectOutputStream oos;


    public ClientSend(Socket socket,ObjectOutputStream oos){
        this.socket=socket;
        this.oos=oos;
    }

    public void run() {
        while(socket!=null){
            try {
                Scanner sc=new Scanner(System.in);
                String msg=sc.nextLine();
                oos.writeObject(msg);
                oos.flush();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}
